home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / hardware / cpu115 / lstring.ash < prev    next >
Text File  |  1995-02-27  |  1KB  |  43 lines

  1. ;------------------------------------------------------------------------------
  2. ; LSTRING.ASH  Lstring definition macro. Defines a string in Pascal format:
  3. ;              <Length>,<string data>[,CR[,LF]]. Such string can be an input
  4. ;           to WriteStr routine defined in DOSINOUT.ASH.
  5. ;
  6. ; Copyright(c) 1992,95 by B-coolWare.  Written by Bobby Z.
  7. ;------------------------------------------------------------------------------
  8.  
  9. CrLf    EQU    1
  10. CrOnly    EQU    2
  11.  
  12. __Lstring__    equ    1
  13.  
  14. LString    macro Name,String,CrLfStat
  15. ;; Parameters: PublicName, String data, Add CR/LF or CR at the end (optional).
  16.  
  17.     MASM51
  18. L_&Name    SIZESTR <&String>    ;; L_Name will be = length(String)
  19.  
  20. if CrLfStat
  21.  if CrLfStat EQ CrLf
  22.   L_&Name = L_&Name+2        ;; if insert CR/LF then length := length+2
  23.  else
  24.   if CrLfStat EQ CrOnly
  25.    L_&Name = L_&Name+1        ;; if insert CR only then length := length+1
  26.   endif 
  27.  endif
  28. endif
  29.  
  30. Name    db     L_&Name, '&String'
  31.  
  32. if CrLfStat 
  33.  if CrLfStat EQ CrLf
  34.     db    13,10        ;; LF,CR
  35.  else
  36.   if CrLfStat EQ CrOnly
  37.     db    13        ;; CR
  38.   endif
  39.  endif
  40. endif
  41.     MASM
  42.     endm
  43.